import { YeeRouter } from '../../types';
import User from '../../controller/api/user';

export const userApis: YeeRouter = {
  prefix: '/api',
  router: [{
    path: '/user', method: 'post', controller: User.createUser, 
    body: {
      user: ['string'],
      password: ['string']
    },
    auth: false,
    comment: '注册接口'
  },{
    path: '/login', method: 'post', controller: User.login,
    body: {
      user: ['string'],
      password: ['string']
    }, 
    auth: false,
    comment: '登录接口'
  },{
    path: '/user/password', method: 'put', controller: User.updateUserPassword, 
    body: {
      oldPassword: ['string'],
      newPassword: ['string'],
      confirmPassword: ['string']
    },
  },{
    path: '/user/auth', method: 'get', controller: User.authUser
  }]
};